/*!
    \copyright  Copyright (c) 2023-2024 Qualcomm Technologies International, Ltd.
                All Rights Reserved.
                Qualcomm Technologies International, Ltd. Confidential and Proprietary.
    \file
    \addtogroup le_unicast_manager
    \brief      Utilities for le unicast manager
    @{
*/
#ifndef LE_UNICAST_MANAGER_UTILS_H
#define LE_UNICAST_MANAGER_UTILS_H

#include "le_unicast_manager_private.h"

/*! \brief Allocates the Audio/Voice source to the device

    \param device       The device to which the source has to be allocated
    \param source_type  Type of source - Audio/Voice
*/
void LeUnicastManager_AllocateSourceToDevice(device_t device, source_type_t source_type);

/*! \brief Removes the Audio/Voice source from the device

    \param device       The device to which the source has to be removed
    \param source_type  Type of source - Audio/Voice
*/
void LeUnicastManager_RemoveSourceFromDevice(device_t device, source_type_t source_type);

/*! \brief Returns TRUE if any CIS is connected

    \param inst  The instance for which CIS needs to be checked

    \return TRUE if any CIS is connected, otherwise FALSE
*/
bool leUnicastManager_IsAnyCisConnected(le_um_instance_t *inst);

/*! \brief Reconfig the Audio/Voice if required and all cis are connected

    \param inst  The unicast manager instance for which the audio reconfig is required

    \return True is reconfig done, otherwise FALSE
*/
bool leUnicastManager_CheckAndReconfigAudio(le_um_instance_t *inst);

/*! \brief Sends the Unicast enabled ind to registered clients

    \param cid            The GATT connection id.
    \param audio_context  The streaming audio context set from the handset device
    \param is_foreground  Is focus foreground/background
*/
void leUnicastManager_SendUnicastEnabledInd(gatt_cid_t cid, uint16 audio_context, bool is_foreground);

/*! \brief Sends the stream inactive ind to registered clients

    \param inst       The unicast manager instance for which the stream has become inactive
*/
void leUnicastManager_SendUnicastDisabledInd(le_um_instance_t *inst);

/*! \brief Sends the Update metadata ind to registered clients

    \param inst                    The unicast manager instance for which the update metadata has been recieved
    \param metadata_audio_context  Metadata Audio context
*/
void leUnicastManager_SendUnicastUpdateMetadataInd(le_um_instance_t *inst, uint16 metadata_audio_context);

/*! \brief Clear all allocated LE audio or LE voice sources from existing devices.
*/
void LeUnicastManager_RemoveAllLeAudioVoiceSources(void);

#endif /* LE_UNICAST_MANAGER_UTILS_H */
/*! @} */
